<template>
	<uv-tabbar zIndex="99" activeColor="#222222" :value="value" @change="changeAct">
		<uv-tabbar-item v-for="(i,n) in list" iconSize="21" :key="n" :text="i.text">
			<template v-slot:active-icon>
				<image class="icon" :src="i.selectedIconPath"></image>
			</template>
			<template v-slot:inactive-icon>
				<image class="icon" :src="i.iconPath"></image>
			</template>
		</uv-tabbar-item>
		
	</uv-tabbar>
</template>
<script>
	export default {
        props:{
            value:{
                type:Number,
                default:0
            }
        },
		data() {
			return {
                list: [{
                		"pagePath": "/pages/tabbar/index",
                		"iconPath": require( "@/static/images/index/tabBar1.png"),
                		"selectedIconPath": require( "static/images/index/tabBar1_a.png"),
                		"text": "首页"
                	},
                	{
                		"pagePath": "/pages/tabbar/chat",
                        "iconPath": require( "@/static/images/index/tabBar2.png"),
                        "selectedIconPath": require( "static/images/index/tabBar2_a.png"),
                	
                		"text": "门店"
                	},
                    {
                    	"pagePath": "/pages/userList/index",
                        "iconPath": require( "@/static/images/index/tabBar3.png"),
                        "selectedIconPath": require( "static/images/index/tabBar3_a.png"),
                    
                    	"text": "台球宝贝"
                    },
                    {
                    	"pagePath": "/pages/meeting/index",
                        "iconPath": require( "@/static/images/index/tabBar4.png"),
                        "selectedIconPath": require( "static/images/index/tabBar4_a.png"),
                    	"text": "赛事"
                    },
                	
                	{
                		"pagePath": "/pages/tabbar/mine",
                        "iconPath": require( "@/static/images/index/tabBar5.png"),
                        "selectedIconPath": require( "static/images/index/tabBar5_a.png"),
                		
                		"text": "我的"
                	}
                ]
                
			}
		},
        methods:{
            changeAct(e){
                console.log(e)
                uni.switchTab({
                    url:this.list[e].pagePath
                })
            }
        }
	}
</script>
<style scoped>
	.icon {
		width: 36rpx;
		height: 36rpx;
	}
</style>